package com.treasure.domain.domain;

import com.treasure.common.types.InteractionId;
import com.treasure.common.types.Question;
import com.treasure.common.model.ChatHistoryEntity;
import com.treasure.domain.domain.entity.ChatHistoryQuery;

/**
 * @author sunhongmin
 * @date 2023/9/6 22:43
 * @description 聊天历史领域服务
 */
public interface ChatHistoryDomainService {

    /**
     * 创建会话
     * @param question
     * @return
     */
    InteractionId createInteractionId(Question question);

    /**
     * 会话校验，防止聊天记录关联失败
     *
     * @param interactionId
     * @return
     */
    boolean checkInteractionExists(Integer interactionId);

    /**
     * 为会话添加聊天记录，异步
     *
     * @param chatHistoryEntity
     */
    void addChatHistory(ChatHistoryEntity chatHistoryEntity);

    /**
     * 获取会话聊天记录
     *
     * @return
     */
    ChatHistoryEntity getChatHistoryList(ChatHistoryQuery chatHistoryQuery);

}
